
package coms.ejb;

import coms.dataaccess.dao.ConferenceItemDAO;
import coms.dataaccess.hibernate.HibernateDAOFactory;
import coms.dto.Conference;
import coms.dto.ConferenceItem;
import coms.dto.User;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.Stateless;

@Stateless (mappedName="ConferenceItemBean")
public class ConferenceItemBean extends GenericBean<ConferenceItem> implements ConferenceItemBeanRemote{

       
  private ConferenceItemDAO conferenceItemDAO;
    
    @PostConstruct
    public void construct(){
        super.construct();
        HibernateDAOFactory factory = new HibernateDAOFactory();
        conferenceItemDAO = factory.getConferenceItemDAO();
    }

@Override
    public List<ConferenceItem> searchBookedConferenceItemByParticipant(User user) {
       return conferenceItemDAO.searchBookedConferenceItemByParticipantAndConference(user, null);
    }

    @Override
    public List<ConferenceItem> searchBookedConferenceItemByParticipantAndConference(User user, Conference conference) {
           return conferenceItemDAO.searchBookedConferenceItemByParticipantAndConference(user, conference);
    }

    
}
